package org.wyf.EveryPoint.crowd.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.wyf.EveryPoint.crowd.entity.CollectionProject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

/**
 * 用户收藏表 Mapper
 *
 * @author wyf
 * @date 2021-04-26 16:43:18
 */
public interface CollectionProjectMapper extends BaseMapper<CollectionProject> {

    @Update("delete from t_collection_project where pid = #{projectId} and uid = #{userId}")
    void deleteUserCollectionProject(@Param("projectId") Long projectId, @Param("userId") Long userId);

    @Select("select * from t_collection_project where pid = #{projectId} and uid = #{userId}")
    List<CollectionProject> listUserCollection(@Param("projectId") Long projectId, @Param("userId") Long userId);
}
